home *** CD-ROM | disk | FTP | other *** search
- #define STRICT
-
- // Includes standard Windows
- #include <windows.h>
- #include <windowsx.h>
- #include <time.h>
- #include <stdlib.h>
- #include <malloc.h>
- #include <memory.h>
- #include <stdio.h>
-
- // Includes D3D
- #define D3D_OVERLOADS
- #include <ddraw.h>
- #include <d3d.h>
- #include <d3dx.h>
-
- // Includes utilitaires D3D
- #include "d3dmath.h"
- #include "d3dutil.h"
- #include "D3DEnum.h"
-
- // Ids Resources
- #include "resource.h"
-
- // Constantes
- #include "const.h"
-
- // Types
- #include "types.h"
-
- // Variables globales projet
- #include "vars.h"
-
- // Prototypes fonctions autres modules
- #include "proto.h"
-
- // Macros
- #include "macros.h"
-
- static struct FileRequester *hFileRequester = (struct FileRequester *) NULL;
-
- int FSInit(void)
- {
- struct TagItem sTagList[] =
- {
- { ASLFR_Screen, (ULONG) hInst},
- { ASLFR_SleepWindow, TRUE},
- { ASLFR_TitleText, (ULONG) "Choisissez un fichier ..."},
- { ASLFR_DoPatterns, TRUE},
- { ASLFR_RejectIcons, TRUE},
- { TAG_DONE, TAG_DONE}
- };
-
- return (int) (hFileRequester = (struct FileRequester *) AllocAslRequest(ASL_FileRequest, sTagList));
- }
-
- int FSelect(char *Bouton, char *Fichier)
- {
- int FResult = 0;
- struct TagItem sTagList[] =
- {
- { ASLFR_InitialPattern, (ULONG) Fichier},
- { TAG_DONE, TAG_DONE}
- };
-
- if (hFileRequester)
- {
- if (FResult = AslRequest(hFileRequester, sTagList))
- {
- strcpy(Fichier, hFileRequester->fr_Drawer);
-
- if (strlen(Fichier))
- if ((Fichier[strlen(Fichier) - 1] != '/')
- && (Fichier[strlen(Fichier) - 1] != ':'))
- strcat(Fichier, "/");
-
- strcat(Fichier, hFileRequester->fr_File);
- }
- }
-
- return(FResult);
- }
-
- void FSClose(void)
- {
- if (hFileRequester)
- {
- FreeAslRequest(hFileRequester);
- hFileRequester = NULL;
- }
- }
-
-